package com.blank.task08;

public class PhoneCard {
    private String cardType;  //卡类型
    private int cardNumber;   //卡号
    private String userName;  //用户名
    private int password;     //密码
    private double accBalances;   //账户余额
    private int talkTime;   //通话时长(分钟)
    private double netFlow;   //上网流量
    private ConsumerInformation consumerInformation;
    //无参构造
    public PhoneCard() {
    }
    //有参构造

    public PhoneCard(String cardType, int cardNumber, String userName, int password, double accBalances, int talkTime, double netFlow,ConsumerInformation consumerInformation) {
        setCardType(cardType);
        setCardNumber(cardNumber);
        setUserName(userName);
        setPassword(password);
        setAccBalances(accBalances);
        setTalkTime(talkTime);
        setNetFlow(netFlow);
        setConsumerInformation(consumerInformation);
    }
    public PhoneCard(String cardType,int cardNumber,String userName){
        setCardType(cardType);
        setCardNumber(cardNumber);
        setUserName(userName);
    }
    public ConsumerInformation getConsumerInformation(){
        return consumerInformation;
    }
    public void setConsumerInformation(ConsumerInformation consumerInformation){
        this.consumerInformation = this.consumerInformation;
    }
    public String getCardType() {
        return cardType;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    public int getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(int cardNumber) {
        this.cardNumber = cardNumber;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getPassword() {
        return password;
    }

    public void setPassword(int password) {
        this.password = password;
    }

    public double getAccBalances() {
        return accBalances;
    }

    public void setAccBalances(double accBalances) {
        this.accBalances = accBalances;
    }

    public int getTalkTime() {
        return talkTime;
    }

    public void setTalkTime(int talkTime) {
        this.talkTime = talkTime;
    }

    public double getNetFlow() {
        return netFlow;
    }

    public void setNetFlow(double netFlow) {
        this.netFlow = netFlow;
    }
    public void show(){
        System.out.println("卡号:"+getCardNumber()+"用户名:"+getUserName()+"当前余额"+getAccBalances());
    }
    /**
     * 多态
     * 打印用户所有信息与各类套餐内容的信息
     */
    public void showAll(AbstractPackage... abstractPackage){
        System.out.println("卡号:"+getCardNumber()+"卡类型:"+getCardType()+"用户名:"+getUserName()+"密码:"+getPassword()+"通话时长:"+getTalkTime()+"上网流量"+getNetFlow()+
                "当前余额"+getAccBalances()+"上网流量"+getNetFlow());
        for (int i = 0; i < abstractPackage.length; i++) {
            abstractPackage[i].showPackageInfo();
        }
    }
    public void cardShow(){
        System.out.println("卡的类型为:"+getCardType()+"卡号:"+getCardNumber()+"用户名"+getUserName());
    }
}
